package com.greenant.store.view;

import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.Button;

import com.greenant.store.R;
import com.greenant.store.activity.AddGoodsByhandActivity;
import com.greenant.store.activity.AddGoodsOnlineActivity;
import com.greenant.store.activity.CaptureActivity;

public class ChooseAddGoodsMethodDialog extends Dialog implements android.view.View.OnClickListener {
	private Context mContext;
	private Button mBtnChooseOnline;
	private Button mBtnChooseByhand;
	private Button mBtnChooseByScan;
	
	public ChooseAddGoodsMethodDialog(Context context) {
		super(context, R.style.choose_date_dialog_style);
		setContentView(R.layout.choose_add_goods_method_dialog);
		mContext = context;
		mBtnChooseOnline = (Button)findViewById(R.id.choose_add_goods_method_online);
		mBtnChooseByhand = (Button)findViewById(R.id.choose_add_goods_method_byhand);
		mBtnChooseByScan = (Button)findViewById(R.id.choose_add_goods_method_byscan);
		mBtnChooseOnline.setOnClickListener(this);
		mBtnChooseByhand.setOnClickListener(this);
		mBtnChooseByScan.setOnClickListener(this);
	}
	
	@Override
	public void onClick(View v) {
		if(v.equals(mBtnChooseOnline)) {
			// 在线添加
			Intent intent = new Intent(mContext, AddGoodsOnlineActivity.class);
			mContext.startActivity(intent);
			this.dismiss();
		}
		else if(v.equals(mBtnChooseByhand)) {
			// 手动添加
			Intent intent = new Intent(mContext, AddGoodsByhandActivity.class);
			mContext.startActivity(intent);
			this.dismiss();
		}
		else if(v.equals(mBtnChooseByScan)) {
			Intent intent = new Intent(mContext, CaptureActivity.class);
			mContext.startActivity(intent);
			this.dismiss();
		}
	}
}















